package stream_test;

import java.util.ArrayList;
import java.util.Collections;

public class test1 {
    public static void main(String[] args) {
        //需求：过滤奇数
        ArrayList<Integer> list=new ArrayList<>();
        Collections.addAll(list,1,2,3,4,5,6,7,8,9,10);
        Object[] objects = list.stream().filter(s -> (s % 2 == 0)).toArray();
        System.out.println(objects.toString());

    }
}
